<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	 Object sessionTime  = request.getSession().getAttribute("orders_time_start");
%>
<!DOCTYPE html >
<html>
<head>
</head>
<c:if test="${code==1}">
	 <script type="text/javascript">
	</script> 
<body >
<div id="searchOrders_div_interval"></div>

	<div id="outside_div">
		<form id="pagerForm" method="post" action="sameCityOrdersAction.action?toResult=searchSameCityOrders&rightId=${rightId}">
			<input type="hidden" name="pageNum" value="${page.currentPage }" /> 
			<input type="hidden" name="pageSize" value="${page.pageSize }" />
			<input type="hidden" name="endDate" value="${endDate}" />
			<input type="hidden" name="searchDays" value="${searchDays}" />
			<input type="hidden" name="orderByType" value="${orderByType}" />
			<input type="hidden" name="areaName" value="${areaName}" />
			<input type="hidden" name="areaId" value="${areaId}" />
			<input type="hidden" name="sendAreaName" value="${sendAreaName}" />
			<input type="hidden" name="sendAreaId" value="${sendAreaId}" />
			<input type="hidden" name="select_orderType" value="${select_orderType}" />
		</form>

		<form id="searchOrders_search" onsubmit="return navTabSearch(this);" action="sameCityOrdersAction.action?toResult=searchSameCityOrders&rightId=${rightId}" method="post">
			<div class="pageHeader">

				<input type="hidden" name="init" value=0>
				<div class="searchBar">
					<div>
					收件人快递区域：
					<a class="btnLook"	href="workAreaLookUp" lookupGroup="courierWorkArea"  width="1000" height="580" warn="请选择网点" >查找带回</a>
					<input id="courierName_Search" bringBackName="courierWorkArea.areaName" value="${areaName}" type="text" name="areaName" readonly="readonly" size="60">
					<input id="courierId_Search" bringBackName="courierWorkArea.areaId" type="hidden"  readonly="readonly" Name="areaId" value="${areaId}"/>
					</div>
					<div>
					寄件人快递区域：
					<a class="btnLook"	href="senderWorkAreaLookUp" lookupGroup="sendCourierWorkArea"  width="1000" height="580" warn="请选择网点" >查找带回</a>
					<input id="courierName_Search" bringBackName="sendCourierWorkArea.areaName" value="${sendAreaName}" type="text" name="sendAreaName" readonly="readonly" size="60">
					<input id="courierId_Search" bringBackName="sendCourierWorkArea.areaId" type="hidden"  readonly="readonly" Name="sendAreaId" value="${sendAreaId}"/>
					</div>
					<table class="searchContent">
					<tr>
					<td>订单类型: 
					<select name="select_orderType" id="OrderType_id">
						<option  value="-1" <s:if test="##request.select_orderType ==-1">selected="selected"</s:if> >所有快递</option>
						<option  value="1" <s:if test="#request.select_orderType==1">selected="selected"</s:if> >公益活动</option>
						<option  value="2"<s:if test="#request.select_orderType==2">selected="selected"</s:if> >同城件订单</option>
					</select>
					</td>
					
					<td>基础订单号: <input type="text" name="baseOrderNo" style="width:100px;" value="${baseOrderNo}"/>
					</td>
					
					</tr>
					<tr>
					<td>排序规则: 
					<select name="sameCityOrderType" id="sameCityOrderType_id">
						<option  value="0" <s:if test="##request.sameCityOrderType ==0">selected="selected"</s:if> >所有快递</option>
						<option  value="1" <s:if test="#request.sameCityOrderType==1">selected="selected"</s:if> >未到件快递</option>
						<option  value="2"<s:if test="#request.sameCityOrderType==2">selected="selected"</s:if> >未分配快递</option>
						<option  value="3"<s:if test="#request.sameCityOrderType==3">selected="selected"</s:if> >已分未到达</option>	
						<option  value="4"<s:if test="#request.sameCityOrderType==4">selected="selected"</s:if> >已到达</option>			
					</select>
					</td>
					
					<td>截止的日期:<input id="search_endDate"  type="text" class="date" name="endDate" value="${endDate}"
								style="width:100px;"	 readonly="readonly" />
					</td>	
					<td>查询总天数:<input onkeyup="value=value.replace(/[^\d.]/g,'')" type="text" min="1" name="searchDays" value="${searchDays}" style="width:100px;" />
					</td>	
					<td>开始日期:<input disabled="disabled" id="search_startDate"  type="text"  name="startDate" value="${startDate} " style="width:100px;"	readonly="readonly" />
					</td>
					
					<td>排序方式:
					<select name="orderByType" id="orderByType_id">
						<option  value="0" <s:if test="#request.orderByType==0">selected="selected"</s:if> >订单状态</option>
						<option  value="1" <s:if test="#request.orderByType==1">selected="selected"</s:if> >收件地址区域</option>
						<option  value="2"<s:if test="#request.orderByType==2">selected="selected"</s:if> >取件快递员</option>
						<option  value="3"<s:if test="#request.orderByType==3">selected="selected"</s:if> >派件快递员</option>
					</select>
					</td>
							<td>
								<div class="buttonActive">
									<div class="buttonContent">
										<button type="submit">检索</button>
									</div>
								</div>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<div class="pageContent">
				<div class="panelBar">
					<ul class="toolBar">
						<c:forEach items="${righSubtList}" var="rightsub">
								<!-- 分配派件员-->	 	
								<c:if test="${fn:contains(rightsub.rightValue,'assignSenderCourier')}">
								<li><a class="add" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}"  target="navTab" width="800" height="500" mask="true"><span>${rightsub.rightName}</span></a>		</li>
								<li class="line">line</li>
							</c:if>	 
						</c:forEach>
						<li class="line">line</li>
					</ul>
				</div>
				<table class="list" width="150%" layoutH="190">
					<thead>
						<tr>
							<th align="center">序号</th>
							<th align="center">小订单号</th>
							<th align="center">二维码编码</th>
							<th align="center">订单类型</th>
							<th align="center">区域代码</th>
						 <!--<th align="center">微信openId</th> -->
							<th align="center">寄件人电话</th>
							<th align="center">寄件人姓名</th>
							<th align="center">寄件地址</th>
							<th align="center">收件人电话</th>
							<th align="center">收件人姓名</th>
							<th align="center">收件地址</th>
							<th align="center">订单来源</th>
							<th align="center">订单状态</th>
							 <th align="center">收件快递员</th>
							  <th align="center">派件快递员</th>
					<!--<th align="center">快递单号</th> -->
							<th align="center">快递公司</th>
					<!-- 		<th align="center">是否支持打印</th> -->
							<th align="center">生成时间</th>
							<!-- <th align="center">备注</th> -->
							<th align="center">支付金额</th>
							<th align="center">优惠金额</th>
							<th align="center">一小时取件奖励</th>
							<th align="center">订单额外奖励</th>
						</tr>
					</thead>
					<tbody>
						<s:iterator var="orders" value="page.data" status="st">
							<tr target="sid_support" rel="<s:property value="#orders.id" />">
								<th width="1%" align="center"><s:property value="page.pageSize * (page.currentPage-1) + #st.index + 1" /></th>
								<th width="3%" align="left"><s:property value="#orders.orderNo" /></th>
								<th width="3%" align="left"><s:property value="#orders.qrCode" /></th>
								<th width="5%" align="left"><s:if test="#orders.orderType==0">
										<span >普通订单</span>
									</s:if> 
									<s:elseif test="#orders.orderType==1">
											<span style="color: red">公益活动</span>
									</s:elseif>
									<s:elseif test="#orders.orderType==2">
											<span style="color: green">同城快递</span>
									</s:elseif></th>
								<th width="3%" align="left"><s:property value="#orders.sednAreaName" /></th>
								<th width="3%" align="left"><s:property value="#orders.senderTelephone" /></th>
								<th width="3%" align="left"><s:property value="#orders.senderName" /></th>
								<th width="11%" align="left"><s:property value="#orders.fromProvinceName" /> 
									<s:property value="#orders.fromCityName" /> 
									<s:property value="#orders.fromDistrictName" /> 
									<s:property value="#orders.fromAddress" />
								</th>
								<th width="3%" align="left"><s:property value="#orders.receiverTelephone" /></th>
								<th width="3%" align="left"><s:property value="#orders.receiverName" /></th>
								<th width="11%" align="left"><s:property value="#orders.toProvinceName" /> 
									<s:property value="#orders.toCityName" /> 
									<s:property value="#orders.toDistrictName" /> 
									<s:property value="#orders.toAddress" />
								</th>
								
								<th width="3%" align="left"><s:property value="#orders.source" /></th>
								<th width="4%" align="left"><s:if test="#orders.orderStatus=='NOT_ASSIGNED'">
										<span style="color: blue">等待接单</span>
									</s:if> <s:elseif test="#orders.orderStatus=='NETSITE_CANCELLED_NOTINAREA'">
										<span style="color: purple">不在范围</span>
									</s:elseif> <s:elseif test="#orders.orderStatus=='NETSITE_CANCELLED_MENDACIOUS'">
										<span style="color: grey">虚假订单</span>
									</s:elseif> <s:elseif test="#orders.orderStatus=='ACCEPTED'">
										<span style="color: RosyBrown">等待取件_未打印</span>
									</s:elseif> <s:elseif test="#orders.orderStatus=='ACCEPTED_PRINTED'">
										<span style="color: brown">等待取件_已打印</span>
									</s:elseif>	<s:elseif test="#orders.orderStatus=='PICKED'">
										<span style="color: DarkOrchid">取件成功_未录入</span>
									</s:elseif> <s:elseif test="#orders.orderStatus=='PICKED_INPUT'">
										<span style="color: green">取件成功_已录入</span>
									</s:elseif> <s:elseif test="#orders.orderStatus=='CANCELLED'">
										<span style="color: red">订单取消</span>
									</s:elseif>
									<s:elseif test="#orders.orderStatus=='SENDED'">
										<span style="color: red">已扫描</span>
									</s:elseif>
									<s:elseif test="#orders.orderStatus=='SENDED_FIN'">
										<span style="color: red">已到达</span>
									</s:elseif>
									</th>
								 <th width="3%" align="left"><s:property value="#orders.courierName" /></th>
								 <th width="3%" align="left"><s:property value="#orders.sendCourierName" /></th>
								 
								<th width="4%" align="left"><s:property value="#orders.expressCompanyName" /></th>
								
								<th width="5%" align="center"><s:date name='#orders.xdDate' format='yyyy-MM-dd HH:mm:ss' /></th>
								<%-- <th width="5%" align="left"><s:property value="#orders.content" /></th> --%>
								<th width="3%" align="left"><s:if test="#orders.basePaymentAmount==0.0">
										<span style="color: red">未支付</span>
									</s:if><s:elseif test="#orders.basePaymentAmount ==null">
										<span style="color: #ccccc">未支付</span>
										</s:elseif>
									 <s:elseif test="#orders.basePaymentAmount!=0.0">
										<s:property value="#orders.basePaymentAmount" />
									</s:elseif></th>
								<th width="3%" align="left"><s:if test="#orders.giftMoney==null">
										<span style="color: #ccccc">未优惠</span>
									</s:if>	
									<s:elseif test="#orders.giftMoney ==0.0">
										<span style="color: #ccccc">未优惠</span>
									</s:elseif>
									 <s:elseif test="#orders.giftMoney !=0.0">
										<span style="color: red"><s:property value="#orders.giftMoney" /></span>
									</s:elseif></th>
									
								<th width="4%" align="left"><s:property value="#orders.oneHourReward" /></th>
								<th width="4%" align="left"><s:property value="#orders.orderReward" /></th>
							</tr>
							<%--  <input id="<s:property value="#orders.id" />" type="button" value="处理" onclick="dealOrder(this)" style="background:red"/> --%>
						</s:iterator>
					</tbody>
				</table>
				<div class="panelBar">
					<div class="pages">
						<span>共${page.totalNum }条，共${page.totalPage }页</span>
					</div>
					<div class="pagination" targetType="navTab" totalCount="${page.totalNum }" numPerPage="${page.pageSize }" pageNumShown="10" currentPage="${page.currentPage }"></div>
				</div>
			</div>
		</form>

	</div>
	</body>
</c:if>
<c:if test="${code==0}">
${message}
</c:if>
</html>